let arr = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 7, 5];
let set=new Set(arr);
console.log(set)
console.log(set.size)
console.log(set.keys())
console.log(set.entries())
set.forEach(item=>{
	console.log(item)
})
set.values()
// 去重
let arr2 = [...new Set(arr)];
console.log(arr2)
// 求交集
let arr3 = [4, 5, 6, 7, 8, 2];
let array_interest = (arr1, arr2) => {
	let a = new Set(arr1);
	return arr2.filter(item => a.has(item));
}
console.log(array_interest(arr,arr3))
// 求并集
let array_comb=(arr1,arr2)=>{
	return [...new Set([...arr1,...arr2])];
}
console.log(array_comb(arr,arr3))
// 差集
let array_diff=(arr1,arr2)=>{
	let a = new Set(arr1);
	return arr2.filter(item => !a.has(item));
}
console.log(array_diff(arr,arr3))
console.log(array_diff(arr3,arr))
